/**
 * 
 */
package mdb.com.vn.web.view;

import java.io.Serializable;
import java.util.List;

import javax.faces.model.ListDataModel;

import mdb.com.vn.model.SmeSms;

import org.primefaces.model.SelectableDataModel;

/**
 * @author tu.dod
 *
 */

public class SmeSmsDataModel extends ListDataModel<SmeSms> implements
SelectableDataModel<SmeSms>, Serializable {

/**
* 
*/
private static final long serialVersionUID = 1L;

public SmeSmsDataModel() {
}
public SmeSmsDataModel(List<SmeSms> loansData) {
super(loansData);
}

@SuppressWarnings("unchecked")
@Override
public SmeSms getRowData(String rowKey) {
// TODO Auto-generated method stub
List<SmeSms> smesmss = (List<SmeSms>) getWrappedData();
for (SmeSms smesms : smesmss) {
	if (String.valueOf(smesms.getId()).equals(rowKey)){
		return smesms;
	}
}
return null;
}

@Override
public Object getRowKey(SmeSms smeSms) {
// TODO Auto-generated method stub
return smeSms.getId();
}

}
